package org.zh.sh.util;

import org.zh.sh.entity.AppUser;
import org.zh.sh.entity.Curriculum;
import org.zh.sh.entity.Student;
import org.zh.sh.entity.Teacher;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class StaticBean {

    public static Map<String, Object> getOneTeacher() {
        Map<String, Object> teacher = new HashMap<>();
        teacher.put(Teacher.teacherAddress, BeanRandom.Address());
        teacher.put(Teacher.teacherGender, BeanRandom.Gender());
        teacher.put(Teacher.teacherBirthday, BeanRandom.Birthday());
        teacher.put(Teacher.teacherAge, BeanRandom.Age((LocalDateTime) teacher.get(Teacher.teacherBirthday)));
        teacher.put(Teacher.teacherEducationalBackground, BeanRandom.EducationalBackground());
        teacher.put(Teacher.teacherEmail, BeanRandom.Email());
        teacher.put(Teacher.teacherEthnicGroup, BeanRandom.EthnicGroup());
        teacher.put(Teacher.teacherIdentityCard, BeanRandom.IdentityCard());
        teacher.put(Teacher.teacherName, BeanRandom.Name((String) teacher.get(Teacher.teacherGender)));
        teacher.put(Teacher.teacherNationality, BeanRandom.Nationality());
        teacher.put(Teacher.teacherOnboardingDate, BeanRandom.OnboardingDate((LocalDateTime) teacher.get(Teacher.teacherBirthday)));
        teacher.put(Teacher.teacherPhoneNumber, BeanRandom.PhoneNumber());
        teacher.put(Teacher.teacherSalary, BeanRandom.Salary());
        teacher.put(Teacher.teacherSchool, BeanRandom.School());
        teacher.put(Teacher.teacherSpecialty, BeanRandom.Specialty());
        teacher.put(Teacher.teacherTeachingCertificate, BeanRandom.TeachingCertificate());
        return teacher;
    }

    public static List<Map<String, Object>> getMoreTeacher() {
        List<Map<String, Object>> teachers = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            teachers.add(getOneTeacher());
        }
        return teachers;
    }


    public static Map<String, Object> getOneStudentCurriculum() {
        Map<String, Object> studentCurriculum = new HashMap<>();
        return studentCurriculum;
    }

    public static List<Map<String, Object>> getMoreStudentCurriculum() {
        List<Map<String, Object>> studentCurriculums = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            studentCurriculums.add(getOneStudentCurriculum());
        }
        return studentCurriculums;
    }


    public static Map<String, Object> getOneStudent() {
        Map<String, Object> student = new HashMap<>();
        student.put(Student.studentAddress, BeanRandom.Address());
        student.put(Student.studentBirthday, BeanRandom.Birthday());
        student.put(Student.studentAge, BeanRandom.Age(LocalDateTime.parse(Student.studentBirthday)));
        student.put(Student.studentEthnicGroup, BeanRandom.EthnicGroup());
        student.put(Student.studentGender, BeanRandom.Gender());
        student.put(Student.studentName, BeanRandom.Name(Student.studentGender));
        student.put(Student.studentNationality, BeanRandom.Nationality());
        student.put(Student.studentPhoneNumber, BeanRandom.PhoneNumber());
        return student;
    }

    public static List<Map<String, Object>> getMoreStudent() {
        List<Map<String, Object>> students = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            students.add(getOneStudent());
        }
        return students;
    }


    public static Map<String, Object> getOneCurriculum() {
        Map<String, Object> curriculum = new HashMap<>();
        curriculum.put(Curriculum.curriculumName, BeanRandom.Name("self"));
        return curriculum;
    }

    public static List<Map<String, Object>> getMoreCurriculum() {
        List<Map<String, Object>> curriculums = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            curriculums.add(getOneCurriculum());
        }
        return curriculums;
    }


    public static Map<String, Object> getOneAppUser() {
        Map<String, Object> appUser = new HashMap<>();
        appUser.put(AppUser.appUserEmail, BeanRandom.Email());
        appUser.put(AppUser.appUserGender, BeanRandom.Gender());
        appUser.put(AppUser.appUserName, BeanRandom.Name((String) appUser.get(AppUser.appUserGender)));
        appUser.put(AppUser.appUserTel, BeanRandom.Tel());
        return appUser;
    }

    public static List<Map<String, Object>> getMoreAppUser() {
        List<Map<String, Object>> appUsers = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            appUsers.add(getOneAppUser());
        }
        return appUsers;
    }


    public static Map<String, Object> getOneAppRole() {
        Map<String, Object> appRole = new HashMap<>();
        return appRole;
    }

    public static List<Map<String, Object>> getMoreAppRole() {
        List<Map<String, Object>> appRoles = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            appRoles.add(getOneAppRole());
        }
        return appRoles;
    }


    public static Map<String, Object> getOneAppUrl() {
        Map<String, Object> appUrl = new HashMap<>();
        return appUrl;
    }

    public static List<Map<String, Object>> getMoreAppUrl() {
        List<Map<String, Object>> appUrls = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            appUrls.add(getOneAppUrl());
        }
        return appUrls;
    }


}
